package com.xiaoxu.rental.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.xiaoxu.rental.entity.AutoBrand;
import com.xiaoxu.rental.entity.AutoMaker;
import com.xiaoxu.rental.mapper.AutoBrandMapper;
import com.xiaoxu.rental.service.AutoBrandService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author xtq
* @description 针对表【auto_brand】的数据库操作Service实现
* @createDate 2024-07-26 08:47:27
*/
@Service
@Transactional
public class AutoBrandServiceImpl extends ServiceImpl<AutoBrandMapper, AutoBrand>
    implements AutoBrandService {
    @Resource
    private AutoBrandMapper autoBrandMapper;

    @Override
    public Page<AutoBrand> searchByPage(Page<AutoBrand> page,
                                        AutoBrand autoBrand) {
        return autoBrandMapper.searchByPage(page,autoBrand);
    }


    //auto_info下找的
    @Override
    public List<AutoBrand> selectByMakerId(Integer makerId) {
        QueryWrapper<AutoBrand> wrapper = new QueryWrapper<>();
        wrapper.eq("mid",makerId);
        return baseMapper.selectList(wrapper);
    }

    @Override
    public boolean hasChildren(Integer id) {
        QueryWrapper<AutoMaker> wrapper = new QueryWrapper<>();

        return false;
    }

}


